PROJECT SUMMARY Treatments for mental health conditions such as unipolar depression provide modest average benefit but have wide variation between individuals and within individuals over time. Evidence-based customized treatment protocols would improve the mental health care of many people by providing treatment recommendations for individuals that take into account potential variation because of personal characteristics such as current health status, symptoms, and response to earlier treatment. Generating customized treatment protocols requires large amounts of data, such as from networks of health systems that can link electronic health records from millions of individuals. Current statistical approaches for discovering customized treatment protocols are limited in three important ways. First, current approaches rely on scientists to select the patient characteristics to use to customize treatments instead of using data to find the patient characteristics that will lead to improved, customized care. Second, customized treatment protocols discovered with current statistical methods assume no unobserved differences between individuals who receive various treatment options. Third, investigators do not have ways to know if the available data contain enough information to discover and compare customized treatment protocols precisely enough to make clinical decisions. We will address these three limitations by developing new statistical tools for discovering customized treatment protocols using electronic health records data. Our research team has expertise and experience in statistics, epidemiology, and mental health care. We will integrate methods that have been successfully used in other settings to improve statistical approaches for discovering customized treatment protocols and address these three important limitations. We will extend machine learning tools for selecting important pieces of information to the time-varying data structure required for discovering customized treatment protocols. We will build approaches that use available knowledge about the size of unobserved differences between groups of people who received different treatments to assess how those differences change study results. By building on the math used to estimate the sample sizes needed for precision in randomized trials with complex designs, we will develop new formulas for determining how many people with a particular condition and who took a particular drug are needed in a health system to provide enough accurate information to discover customized treatment protocols. Using data from the electronic health records of more than 15,000 patients, we will discover customized treatment protocols for depression. By improving statistical tools and addressing current limitations, our customized treatment protocols will have immediate impact for people living with unipolar depression. The statistical tools we develop will also be useful for discovering customized treatment protocols for people with a wide variety of mental health conditions.